package com.tuling.base;

import java.util.ArrayList;
import java.util.List;

class Value{
    public int i=15;
}
public abstract class Test{

    abstract void method();
    public static void main(String argv[]){
//        Test t=new Test( );
//        t.first( );

        List strings = new ArrayList();

//        String o = strings.get(0);

        Object obj = new Object();
        String s1 = "coder";
        String s2 = "coder";
        String s32 = "coder" + s1;
        String s3 = "coder" + s2;
        String s4 = "coder" + "coder";
        String s5 = s1 + s2;
        System.out.println(s32 == s3);
        System.out.println(s3 == s4);
        System.out.println(s3 == s5);
        System.out.println(s4 == "codercoder");

        System.out.println("================");

        String a = new String("myString");
        String b = "myString";
        String c = "my" + "String";
        String d = c;
        System.out.println(a == b);//fasle
        System.out.println(a == c); //fasle
        System.out.println(b == c); //true
        System.out.println(b == d);//true
//        0000000com.tuling.base.Value@26653222
//        1111111com.tuling.base.Value@3532ec19
//        222222com.tuling.base.Value@3532ec19
//        15 0
//        20


    }

    public void first( ){
        int i=5;
        Value v=new Value( );
        v.i=25;
        System.out.println("0000000"+v);
        second(v,i);
        System.out.println(v.i);
    }

    public void second(Value v,int i){
        i = 0;
        v.i = 20;
        Value val = new Value( );
        //此时v 的地址变了
        v = val;
        System.out.println("1111111"+v);
        System.out.println("222222"+val);
//        System.out.println(val.i);
        System.out.println(v.i+" "+i);
    }
}
